clsService
This class is returned by the clsServices class (one per service
listed), but you can also use it independently to access a specific system, in the local
machine or through a network. To access a specific service, just set the name or the
display name of the service you want to access. The class will update itself automatically
with the information of the service. Using this class you can also start, stop, pause or
continue services. |
Properties:
- BinaryPathName. Path to the binary file of the
service.
- CheckPoint as Long.
- ComputerName as String. By default, this property is
empty if you are using this class independently, or has the same value as the class
clsServices is this class is an item of the other. You can specify another name to access
a service in another computer.
- ControlsAccepted as enControlsAccepted. Possible
values are: Accept Pause & Continue, Accept Shutdown or Accept Stop. Also, it could be
any combination of these values. To know if a service accepts a certain control, use this
expression: CBool ( Svc.ControlsAccepted And Accept Stop). If the expression returns True,
then the service accepts the control Stop.
- CurrentState as enServiceStatus. Possible values are:
Continue Pending, Pause Pending, Paused, Running, Start Pending, Stop Pending or Stopped.
You can also set this property to Start, Stop or Pause to modify the state of the service.
- Dependencies as clsSVCDependencies. This property
will return an object that contains the dependecies of the service, if any.
- DisplayName as String. Display name for the service
(those you can see in the services control manager).
- LoadOrderGroup as String.
- Name as String. Internal name of the service.
- ServiceSpecificExitCode as Long.
- ServiceType as enServiceType. Possible values are:
File System Driver, Kernel Driver, WIN32 Own Process, WIN32 Share Process, Interactive
WIN32 Own Process or Interactive WIN32 Share Process.
- StartErrorSeverity as enStartErrorSeverity. Possible
values are: Ignore Error, Normal Error, Severe Error ore Critical Error. Informs on how
there server will act if an error ocurres at startup.
- StartName. Depending on the type of service, this can
be the name of the account under which the service is running.
- StartType as enStartType. Possible values are: Auto
Start, Boot Start, Demand Start, Disabled, System Start. Indicates how the service is
started.
- TagID as Long.
- WaitHint as Long.
- Win32ExitCode as Long.
|
Methods:
- ContinueService as Boolean. Use this method to
continue the service if it is paused. Returns True of successful or False if an error
ocurred.
- PauseService as Boolean.Use this method to pause a
service if it is running. Returns True of successful or False if an error ocurred.
- StartService as Boolean. Use this method to start a
service if it is stopped. Returns True of successful or False if an error ocurred.
- StopService as Boolean. Use this method to stop a
service if it is running. Returns True of successful or False if an error ocurred.
- Refresh. Forces the library to update the information
about the service. Returns True of successful or False if an error ocurred.
|